package redora.test.rdo.service;

import java.util.Set;
import redora.api.BusinessRuleViolation;
import redora.exceptions.BusinessRuleViolationException;
import redora.test.rdo.service.base.JUnitMasterBusinessRulesBase;
import redora.test.rdo.model.JUnitMaster;
import redora.test.rdo.service.JUnitMasterUtil;

public class JUnitMasterBusinessRules extends JUnitMasterBusinessRulesBase {
	public JUnitMasterBusinessRules(JUnitMasterUtil util) {
		super(util);
	}
	
	@Override
	public Set<BusinessRuleViolation> onInsert(JUnitMaster pojo) throws BusinessRuleViolationException {
		return super.onInsert(pojo);
	}
	
	@Override
	public Set<BusinessRuleViolation> onUpdate(JUnitMaster pojo) throws BusinessRuleViolationException {
		//Set<BusinessRuleViolation> retval = super.onUpdate(pojo);
		//for example check if the updateDate is newer then the last updateDate
		//if (pojo.dirty.containsKey(JUnitMasterFields.updateDate) {
		//  if (pojo.dirty.get(JUnitMasterFields.updateDate) != null && pojo.dirty.get(JUnitMasterFields.updateDate).compareTo(pojo.getUpdateDate() > 0) {
		//    retval.add(new BusinessRuleViolation(
		//		JUnitMaster, JUnitMasterFields.updateDate, BR_1, Action.Update));
		//  }
		//}
		return super.onUpdate(pojo);
	}
	
	@Override
	public Set<BusinessRuleViolation> onDelete(JUnitMaster pojo) throws BusinessRuleViolationException {
		return super.onDelete(pojo);
	}
}
